<?php

namespace Nimo\Bundle\BookstoreApiBundle\Form\Book;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class BookType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('title')
            ->add('brief')
            ->add('press')
            ->add('meta')
            ->add('publishedYear')
            ->add('bestseller')
            ->add('cover')
            ->add('rating')
            ->add('price')
            ->add('lastViewedDate')
            ->add('isDraft')
            ->add('viewCount')
            ->add('soldCount')
            ->add('isbnCode')
            ->add('pageCount')
            ->add('language')
            #->add('author')
            #->add('category')
            #->add('tags')
            #->add('relating_books')
            #->add('related_books')
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Nimo\Bundle\BookstoreApiBundle\Entity\Book\Book'
        ));
    }

    public function getName()
    {
        return 'nimo_bundle_bookstoreapibundle_book_booktype';
    }
}
